package com.ztgf.sms.service.sms;


import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ztgf.sms.common.config.YmlConfig;
import com.ztgf.sms.mapper.sms.SmsPassagewayMapper;
import com.ztgf.sms.models.bo.SmsPassagewaySaveBO;
import com.ztgf.sms.models.dto.sms.SmsPassagewayDTO;
import com.ztgf.sms.models.service.ISmsPassagewayService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;

import javax.annotation.Resource;

/**
 * 短信通道管理表控制器
 *
 * @author chenyu.wang
 * @Date 2021-01-27 11:55:15
 */
@DubboService
public class SmsPassagewayServiceImpl extends ServiceImpl<SmsPassagewayMapper, SmsPassagewayDTO> implements ISmsPassagewayService {

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(SmsPassagewaySaveBO saveBO) {
        SmsPassagewayDTO dto = new SmsPassagewayDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
